home *** CD-ROM | disk | FTP | other *** search
- Path: isonews.bbn.hp.com!hpbblb!news
- From: Matthias Dittrich <matti>
- Newsgroups: comp.lang.c
- Subject: Re: Using multiple modules
- Date: 4 Mar 1996 09:20:10 GMT
- Organization: Hewlett-Packard Co.
- Message-ID: <4hecka$qf2@hpbblb.bbn.hp.com>
- References: <4h9led$b4g@news.doit.wisc.edu>
- NNTP-Posting-Host: trabant.bbn.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
- X-URL: news:4h9led$b4g@news.doit.wisc.edu
-
- jdscott@students.wisc.edu (Jim Scott) wrote:
- >I'm trying to break up growing source code into multiple modules. As
- >per the FAQ, I've moved all my external definitions to a header file
- >included in both the modules I'm working with.
- >
- >I can compile the source code into separate object files, but am unable
- >to link. I get one of two errors:
- >
- >"symbol defined more than once" this is in reference to the only
- >function in the second object file. I've checked, and it is only
- >defined in the header file.
- >
- >"unresolved externals" and a reference to a ??main?? file. No clue
- >what's happening here.
- >
- >In the meantime, I'm simply working with the single source file. Any
- >help is greatly appreciated!
- >
- It seems you havn't set the compiler options correctly. Compile each file
- with option -c, that gives you a .o file as output. In a second step
- link all the .o files to the execuatable program.
-
- Good luck,
- Matthias
-
-